<html>
<head><meta charset="utf-8"><title>UI test error annotations · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/UI.20test.20error.20annotations.html">UI test error annotations</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="208859299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/UI%20test%20error%20annotations/near/208859299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> katelyn martin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/UI.20test.20error.20annotations.html#208859299">(Sep 02 2020 at 17:29)</a>:</h4>
<p>Hello! I have a question about error annotations in the UI tests in <code>src/test/ui/</code>. (See <a href="https://rustc-dev-guide.rust-lang.org/tests/adding.html#error-annotations">https://rustc-dev-guide.rust-lang.org/tests/adding.html#error-annotations</a>)</p>
<p>I have a small test program that looks like this:</p>
<div class="codehilite"><pre><span></span><code><span class="k">extern</span><span class="w"> </span><span class="s">&quot;C-unwind&quot;</span><span class="w"> </span><span class="k">fn</span> <span class="nf">f</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="c1">//~^ ERROR 4:8: 4:18: C-unwind ABI is experimental and subject to change [E0658]</span>
</code></pre></div>


<p>If I remove the leading <code>4:8: 4:18</code> and the trailing <code>[E0658]</code>, my test fails. I've looked at other similar tests such as <code>src/test/ui/feature-gates/feature-gate-abi-msp430-interrupt.rs</code> as well as the documentation and don't see other examples that look like this, so I'm inclined to think I'm doing something wrong.</p>
<p>Does anybody know what may be going wrong here?</p>



<a name="208859836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/UI%20test%20error%20annotations/near/208859836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> katelyn martin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/UI.20test.20error.20annotations.html#208859836">(Sep 02 2020 at 17:33)</a>:</h4>
<p>I should disclaim here as well that I tried to add the feature gate for my ABI string by adding a new <code>gate_feature_post!</code> call to <code>PostExpansionVisitor::check_abi</code>. Is it possible that I'm looking in the wrong place?</p>



<a name="208887847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/UI%20test%20error%20annotations/near/208887847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/UI.20test.20error.20annotations.html#208887847">(Sep 02 2020 at 21:06)</a>:</h4>
<p><span class="user-mention" data-user-id="327458">@katelyn martin</span> if you remove the line numbers but not <code>[E0658]</code> does it work?</p>



<a name="208887888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/UI%20test%20error%20annotations/near/208887888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/UI.20test.20error.20annotations.html#208887888">(Sep 02 2020 at 21:07)</a>:</h4>
<p>if not it would be helpful to see the output that fails, it will be in <code>src/test/ui/feature-gates/feature-gate-abi-msp430-interrupt.stderr</code></p>



<a name="208889162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/UI%20test%20error%20annotations/near/208889162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> katelyn martin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/UI.20test.20error.20annotations.html#208889162">(Sep 02 2020 at 21:17)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> That fixed it! Thank you so much <span aria-label="pray" class="emoji emoji-1f64f" role="img" title="pray">:pray:</span></p>



<a name="208890081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/UI%20test%20error%20annotations/near/208890081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/UI.20test.20error.20annotations.html#208890081">(Sep 02 2020 at 21:26)</a>:</h4>
<p>you're welcome <span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>